package cn.itcast.order.web;

import cn.itcast.order.pojo.Order;
import cn.itcast.order.service.OrderService;
import com.alibaba.csp.sentinel.annotation.SentinelResource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("order")
public class OrderController {

   @Autowired
   private OrderService orderService;

//    @GetMapping("{orderId}")
//    public Order queryOrderByUserId(@PathVariable("orderId") Long orderId) {
//        // 根据id查询订单并返回
//        return orderService.queryOrderById(orderId);
//    }
        @SentinelResource("orderIdididi")
    @GetMapping("{orderId}")
    public String queryOrderByUserId(@PathVariable("orderId") Long orderId) {
        // 根据id查询订单并返回
        return "成功成功了成功了成功成功了成功了成功成功了成功了成功成功了" +
                "成功了成功成功了成功了成功成功了成功了" +
                "成功成功了成功了成功成功了成功了" +
                "成功成功了成功了成功成功了成功了" +
                "成功成功了成功了成功成功了成功了" +
                "成功成功了成功了成功成功了成功了" +
                "成功成功了成功了成功成功了成功了成功成功了" +
                "成功了成功成功了成功了";
    }


    @GetMapping("query")
    public String orderQuery() {
        return "查询订单";
    }
//    @GetMapping("update")
//    public String orderUpdate() {
//        return "修改订单";
//    }
//    @GetMapping("query")
//    public String orderqueryGODS() {
//         orderService.queryGoods();
//         return "查询限制";
//
//    }
//    @GetMapping("save")
//    public String ordersaveGODS() {
//        orderService.queryGoods();
//        return "保存方法save";
//    }
}
